package myapp.framelibrary.http;

import android.content.Context;

import com.google.gson.Gson;

import java.util.Map;

import myapp.baselibrary.http.EngineCallBack;
import myapp.baselibrary.http.HttpUtils;

/**
 * Created by 超 on 2017/6/27.
 */

public abstract class HttpCallBack<T> implements EngineCallBack {
    @Override
    public void onPreExecute(Context context, Map<String, Object> params) {

    }

    public void onPreExecute(){

    }

    @Override
    public void onSuccess(String result) {
        Gson gson = new Gson();
        T t = (T) gson.fromJson(result, HttpUtils.analysiscClazzInfo(this));
        onSuccess(t);
    }


    public abstract void  onSuccess(T result);
}
